#pragma once
#include <Rz/Object.h>
#include "EventArgs.h"

#include <type_traits>

#define RZ_EVENT_CHECK_ARGUMENT_ERROR                                                            \
	static_assert(std::is_reference<ArgsT>::value, "Second argument have to be reference!");     \
	static_assert(std::is_base_of<EventArgs, typename std::remove_reference<ArgsT>::type>::value, "Second argument have to derive from EventArgs!")

namespace Rz {

class IEventCallback
	: virtual public IObject
{
    public:
		RZ_RTTI_INTERFACE(Rz, IEventCallback);
		RZ_RTTI_IMPLEMENTS(IObject);
		RZ_RTTI_END;

        typedef void (*FunctionType)(Object&, EventArgs&);
        typedef void (Object::*MethodFunctionType)(Object&, EventArgs&);

        virtual void Callback(Object& sender, EventArgs& e) = 0;
};

}